package day16.pack6;

import java.io.*;

public class Test {
    public static void main(String[] args) {
        File sourceFile = new File("d:\\seecen.txt");
        File distFile = new File("d:\\seecen_copy.txt");
        // 字符流本身是不存在的，只有字节流，这个字符流的底层还是字节流
        // JDK用字节流帮我们封装好了一套字符流
        try (Reader reader = new FileReader(sourceFile);
            Writer writer = new FileWriter(distFile);
        ) {
            int len = 0;
            char[] data = new char[128];
            while((len = reader.read(data)) != - 1) {
                writer.write(data, 0, len);
            }
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }


    }
}
